<!--<?php
print <<<EOT
-->

<script src="css/edit.js"></script>
<script>
<!--

function addWishlist(id) {
    url = "wishlist_view.php?act=add&pid="+id;
    open(url,'wishlist_page');
}

function validate(form) {
    var id_ary = $js_id_ary_str;
    var qty_flag = 0;
    
    for (var i=0; i<id_ary.length; i++) {
        
        if (parseInt(document.all('p_num['+id_ary[i]+']').value) > parseInt(document.all('p_qty['+id_ary[i]+']').value)) {
            alert('Item '+document.all('id_code['+id_ary[i]+']').value+': Order Qty should not be more than the Available Qty.');
            return false;
        }
        
        if (document.all('p_num['+id_ary[i]+']').value != '' && isDigit(document.all('p_num['+id_ary[i]+']').value) && parseInt(document.all('p_num['+id_ary[i]+']').value) > 0) {
            qty_flag = 1;            
        }
        

        
    }
    
    if (qty_flag == 0) {
        alert('Please enter the order qty !');
        return false;
    }
    return true;
}

//-->
</script>

        <tr>
          <td background="./images/colour/jf_colour_gold_100.gif" width="1"><img src="./images/spacer.gif" width="1" height="1" alt=""></td>
          <td bgcolor="FFFFFF" width="10"><img src="./images/spacer.gif" width="10" height="1" alt=""></td>
          <td bgcolor="FFFFFF" width="720" align="left" valign="top"><div><img name="" src="./images/spacer.gif" width="720" height="10" alt=""></div>
            <table width="720" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" background="./images/nav/jf_nav_main_bkgd.gif" align="left" valign="top"><table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td colspan=2><a href="index.php"><img src="./images/nav/jf_nav_logo.gif" width="150" height="210" alt="jans2en furniture" border="0"></a></td>
                    </tr>

<!--
EOT;
$guide = "";
foreach ($LEFT_MENU_ARY as $k=>$v) { 
    if ($menu_id == $k) { 
    	foreach ($inventory_show_ary as $k1=>$v1) {
    		$hover_menu = $v1['id']==$inventoryid ? "<font color='#b68f2e' size=3>&#8226;</font>" : "<font size=3>&#8226;</font>" ;
    		$add = '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
            $category_list .= '<tr><td class="menu_list"><a href="inventory_category.php?inventoryid=' . $v1['id'] . $special_flag . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $hover_menu . '&nbsp;<strong>' . br2br($v1['name'], $add, 18) . '</strong></a></td><td width="6%"></td></tr>';         
            
            if (isset($this_type) && $this_type == 2) {
            	$guide =  "&gt;" . $this_name;
			} else {
            if ($v1['id'] == $inventoryid) {
            	$guide .=  "&gt;<a href='inventory_category.php?inventoryid=" . $inventoryid . $special_flag . "'>" . $v1['name'] . "</a>";
            	foreach ($out_ary as $k2=>$v2) {   
            		if ($cate_id == $v2['id'] && $fid == 0) {
		    			$guide .=  "&gt;<span class='breadcrumbActive'>" . $v2['name'] . "</span>";
		    		} else if ($cate_id == $v2['id']) {
		    			$guide .=  "&gt;<a href='inventory_list.php?inventoryid=" . $inventoryid . "&fid=" . $fid . "&categoryid=" . $categoryid . $special_flag . "'>" . $v2['name'] . "</a>";
		    		}         
		            $hover_category = $categoryid == $v2['id'] ? "<font color='#b68f2e' size=2>&#8226;</font>" : "<font size=2>&#8226;</font>" ;

		            $add = '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
		            $category_list .= '<tr><td class="menu_list"><a href="inventory_list.php?inventoryid=' . $inventoryid . '&categoryid=' . $v2['id'] . $special_flag . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $hover_category . '&nbsp;<strong>' . br2br($v2['name'], $add, 18) . '</strong></a></td><td width="6%"></td></tr>';
		            /*
		            if ($cate_id == $v2['id']) {
		            	if (!empty($sub_out_ary)) {
		                    foreach ($sub_out_ary as $k3=>$v3) {
		                    	if ($categoryid == $v3['id']) {
					    			$guide .=  "&gt;<span class='breadcrumbActive'>" . $v3['name'] . "</span>";
					    		}
					    		$add = '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
					    		//$add = '8888888';
		                        $hover_sub_category = $categoryid == $v3['id'] ? "<font color='#b68f2e'>&#8226;</font>" : "&#8226;" ;		                        
		                        $category_list .= '<tr><td class="menu_list_sub"><a href="inventory_list.php?inventoryid=' . $inventoryid . '&fid=' . $cate_id . '&categoryid=' . $v3['id'] . $special_flag . '">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $hover_sub_category . '&nbsp;<strong>' . br2br($v3['name'], $add, 15) . '</strong></a></td><td width="6%"></td></tr>';
		                    }
		                }
		            }*/
            	}
            }
            }
        }
print <<<EOT
-->
					<tr>
                      <td colspan="2"><a href="{$v['url']}"><img src="./images/nav/{$v['pic']}-active.gif" alt="{$v['name']}" name="jf_nav_menu_$k" width="150" height="20" id="jf_nav_menu_$k" border="0"></a></td>
                    </tr>
                    $category_list

<!--
EOT;
	} else {
print <<<EOT
--> 

					<tr>
                      <td colspan="2"><a href="{$v['url']}" onMouseOver="MM_swapImage('jf_nav_menu_$k','','./images/nav/{$v['pic']}-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="./images/nav/{$v['pic']}.gif" alt="{$v['name']}" name="jf_nav_menu_$k" width="150" height="20" id="jf_nav_menu_$k" border="0"></a></td>
                    </tr>

<!--
EOT;
	}
} 
print <<<EOT
--> 

                  </table></td>
                <td background="./images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                <td width="568" align="left" valign="top" background="./images/colour/jf_colour_navy_07.gif"><table width="568" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="./images/colour/jf_colour_navy_100.gif" height="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                    </tr>
                    <tr>
                      <td bgcolor="FFFFFF" align="left" valign="middle" class="breadcrumb" height="14">&nbsp;<a href='index.php'>Home</a>&gt;{$page_guide_name2}{$guide}</td>
                    </tr>
                  </table>
                  <div><img src="./zh/attachments/{$category_pic_2}" alt="How To Order" name="jf_section_header_placer" width="568" height="95" id="jf_section_header_placer"></div>
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>
                  <div align="right">Updated on $update_time &nbsp;</div>
                  <table width="568" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      <td bgcolor="FFFFFF" width="548"><div><img name="" src="./images/spacer.gif" width="538" height="5" alt=""></div>
                        <table width="538" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td class="show_title">$category_name</td>
                          </tr>
                          <tr>
                            <td background="./images/colour/jf_colour_navy_100.gif"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                          </tr>
                          <tr>
                            <td><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                          </tr>
                          <tr>
                            <td align="center" class="pageTitleText">{$page_show['str']}</td>
                          </tr>
                          <tr>
                            <td align="center" class="pageListings">{$page_show['pagelink']}</td>
                          </tr>
                        </table>
                        <div><img name="" src="./images/spacer.gif" width="538" height="5" alt=""></div></td>
                      <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                      <td  background="./images/colour/jf_colour_navy_15.gif" align="left" valign="top" width="1"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="2" alt=""></td>
                      <td  background="./images/colour/jf_colour_navy_15.gif" align="left" valign="top" height="1" colspan="4"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="2" alt=""></td>
                    </tr>
                  </table>
                  
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>
                  
                  <iframe name='addtocontentiframe' width=0 height=0 src="about:blank" id='addtocontentiframe'></iframe>
                  
                  <form action="cart_view.php" method="post" name="form1" onSubmit="return validate(this)" target="addtocontentiframe">
    	    	  <input type="hidden" name="act" value="adddate">
    	    	  <input type="hidden" name="inventorytype" value="$inventory_type">
    	    	  <input type="hidden" name="inventoryid" value="$inventoryid">
    	    	  <input type="hidden" name="intype" value="$inventoryid">
    	    	  <input type="hidden" name="js" value="1">
                  <table width="568" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"></td>
                      <td width="136"></td>
                      <td width="136"></td>
                      <td width="136"></td>
                      <td width="136"></td>
                      <td width="4"></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>

               
<!--
EOT;
$index = 1;
foreach ($product_ary as $k=>$v) {
    $str = '';
    
    
    if ($index%4 == 0 && $index>3) {
        $str       = '<td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>';
        
    } else {
        $str = '';    
    }
    $start_limit_1 = $start_limit+$index;
    if (trim($v['small_pic']) == "" || !file_exists("./zh/attachments/" . $v['small_pic'])) {
        $v['small_pic'] = 'no.gif';
    }
    $price_show = '';
    if ($jansen_type==2) {
        $sp = isset($sp_ary[$v['id']]) ? $sp_ary[$v['id']] : 0;
        echo $sp;
        $sp = number_format($sp, 2, '.', ',');
        if ($sp == 0) {
            $sp_div = '';
            $sp_div1 = '<div class="price">&nbsp;</div>';
        } else {
            $sp = number_format($sp, 2, '.', ',');
            $sp_div = '<div class="price">Special: ' . $sp . ' USD</div>';
            $sp_div1 = '';
        }
        $show_text = $sp==0 ? "Price" : "Regular";
        if ($inventory_type == 2) {
            //$sp = $sp==0 ? ' - ' : (float)$sp . '';
            $v['price_2'] = number_format($v['price_2'], 2, '.', ',');
            $price_show = '<div class="price">' . $show_text . ': ' . $v['price_2'] . ' USD</div>
	                       ' . $sp_div;
        } else {
            //$sp = $sp==0 ? ' - ' : (float)$sp . '';
            $v['price_1'] = number_format($v['price_1'], 2, '.', ',');
            $price_show = '<div class="price">' . $show_text . ': ' . $v['price_1'] . ' USD</div>' . $sp_div;
        }
    	
    } elseif ($jansen_type == 1) {
        $sp = isset($sp_ary2[$v['id']]) ? $sp_ary2[$v['id']] : 0;
        $sp = number_format($sp, 2, '.', ',');
        if ($sp == 0) {
            $sp_div = '';
            $sp_div1 = '<div class="price">&nbsp;</div>';
        } else {
            $sp = number_format($sp, 2, '.', ',');
            $sp_div = '<div class="price">Special: ' . $sp . ' HKD</div>';
            $sp_div1 = '';
        }
        $show_text = $sp==0 ? "Price" : "Regular";
        $v['price_3'] = number_format($v['price_3'], 2, '.', ',');
    	$price_show = '<div class="price">' . $show_text . ': ' . $v['price_3'] . ' HKD</div>
	                   ' . $sp_div;
    }
print <<<EOT
-->    	

    	              <td align="center">
    	                <table width="136" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td bgcolor="FFFFFF" width="115"><img name="" src="./images/spacer.gif" width="115" height="10" alt=""></td>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td width="1" align="left" valign="top" background="./images/colour/jf_colour_navy_15.gif"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                          </tr>
                          <tr>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td bgcolor="FFFFFF" width="115"><div><a href="inventory_details.php?inventoryid=$inventoryid&categoryid=$categoryid&pid={$v['id']}&fid={$fid}{$special_flag}"><img src="./zh/attachments/{$v['small_pic']}" alt="Image of {$v['code']}" name="jf_product_images_sm_image_{$v['id']}" width="113" height="113" class="picture" id="jf_product_images_sm_image_{$v['id']}" border="0"></a></div>
                              <div><img src="./images/spacer.gif" width="115" height="5" alt=""></div>
                              <div align="left"><a href='inventory_details.php?inventoryid=$inventoryid&categoryid=$categoryid&pid={$v['id']}&fid={$fid}{$special_flag}'>{$v['code']}</a></div>
                              <div><img src="./images/spacer.gif" width="115" height="5" alt=""></div>
                              
                              $price_show
                              <div class="price">Available Qty:&nbsp;{$product_qty_ary[$v['id']]}</div>
                              <div class="price">Order Qty:&nbsp;<input class="form" name="p_num[{$v['id']}]" size="2" value="" /></div>
                              <input type="hidden" name="p_qty[{$v['id']}]" value="{$product_qty_ary[$v['id']]}">
                              <input type="hidden" name="id_code[{$v['id']}]" value="{$v['code']}">
                              $sp_div1
                    		  <!--div><a href="javascript:;" onclick="addWishlist('{$v['id']}')"><img src="./images/button/jf_button_wishlist.gif" alt="Add to Wishlist" width="82" height="13" border="0" id="jf_button_wishlist_{$v['id']}"></a></div-->
                            </td>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td width="1" align="left" valign="top" background="./images/colour/jf_colour_navy_15.gif"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                          </tr>
                          <tr>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td bgcolor="FFFFFF" width="115"><img name="" src="./images/spacer.gif" width="115" height="10" alt=""></td>
                            <td bgcolor="FFFFFF" width="10"><img name="" src="./images/spacer.gif" width="10" height="10" alt=""></td>
                            <td width="1" align="left" valign="top" background="./images/colour/jf_colour_navy_15.gif"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                          </tr>
                          <tr>
                            <td width="10" align="left" valign="top" background="./images/colour/jf_colour_navy_15.gif"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                            <td background="./images/colour/jf_colour_navy_15.gif" width="115"><img name="" src="./images/spacer.gif" width="115" height="1" alt=""></td>
                            <td background="./images/colour/jf_colour_navy_15.gif" width="10"><img name="" src="./images/spacer.gif" width="10" height="1" alt=""></td>
                            <td width="1" align="left" valign="top" background="./images/colour/jf_colour_navy_15.gif"><img name="" src="./images/colour/jf_colour_navy_15.gif" width="1" height="1" alt=""></td>
                          </tr>
                        </table>
                      </td>
                      $str

<!--
EOT;
    $index++;
} 
print <<<EOT
-->                                                          
                      
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td align="left"><img name="" src="./images/spacer.gif" width="136" height="4" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr height=20 valign-"middle"><td colspan=5 align="right"><input type="image" onMouseOver="MM_swapImage('jf_button_add_all_to_cart','','./images/button/jf_button_add_all_to_container-over.gif',1)" onMouseOut="MM_swapImgRestore()" src="./images/button/jf_button_add_all_to_container.gif" alt="Login" name="jf_button_add_all_to_cart" width="120" height="20" border="0" id="jf_button_add_all_to_cart">&nbsp;</td><td width="4"></td></tr>
                  </table>
                  </form>
                  
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>    
                  
                   <table width="568" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td bgcolor="FFFFFF" width="548"><table width="548" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="548" height="14" align="center" valign="middle" class="pageListings">{$page_show['pagelink']}</td>
                          </tr>
                        </table></td>
                      <td bgcolor="FFFFFF" width="5"><img name="" src="./images/spacer.gif" width="5" height="5" alt=""></td>
                      <td  background="./images/colour/jf_colour_navy_15.gif" align="left" valign="top" width="1"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="4" alt=""></td>
                    </tr>
                    <tr>
                      <td width="5"><img name="" src="./images/spacer.gif" width="5" height="2" alt=""></td>
                      <td  background="./images/colour/jf_colour_navy_15.gif" align="left" valign="top" height="1" colspan="4"><img name="" src="./images/colour/jf_colour_navy_07.gif" width="1" height="1" alt=""></td>
                      <td width="4"><img name="" src="./images/spacer.gif" width="4" height="2" alt=""></td>
                    </tr>
                  </table>
                  
                  <div><img name="" src="./images/spacer.gif" width="568" height="4" alt=""></div>
                               
                  <div><img name="" src="./images/spacer.gif" width="10" height="2" alt=""></div></td>
                <td background="./images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
              </tr>
              <tr>
                <td background="./images/nav/jf_nav_main_bkgd.gif" wid><img name="" src="./images/spacer.gif" width="150" height="20" alt=""></td>
                <td background="./images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                <td><table width="568" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td background="./images/colour/jf_colour_navy_100.gif" height="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                      <td background="./images/colour/jf_colour_navy_100.gif" height="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                    </tr>
                    <tr>
                      <td align="left" valign="middle" height="18"></td>
                      <td align="right" valign="middle" height="18"><a href="#top" onMouseOver="MM_swapImage('jf_button_back_to_top','','./images/button/jf_button_back_to_top-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="./images/button/jf_button_back_to_top.gif" alt="Back to top" name="jf_button_back_to_top" width="70" height="13" border="0" id="jf_button_back_to_top"></a></td>
                    </tr>
                    <tr>
                      <td background="./images/colour/jf_colour_navy_100.gif" height="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                      <td background="./images/colour/jf_colour_navy_100.gif" height="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
                    </tr>
                  </table></td>
                <td background="./images/colour/jf_colour_navy_100.gif" width="1"><img name="" src="./images/spacer.gif" width="1" height="1" alt=""></td>
              </tr>
            </table>
            <div><img name="" src="./images/spacer.gif" width="720" height="10" alt=""></div></td>
          <td bgcolor="FFFFFF" width="10"><img src="./images/spacer.gif" width="10" height="10" alt=""></td>
          <td background="./images/colour/jf_colour_gold_100.gif" width="1"><img src="./images/spacer.gif" width="1" height="1" alt=""></td>
        </tr>
        
<!--
EOT;
?>-->